package com.dg.lecheng.api.user.repo;

import com.dg.lecheng.api.base.repo.ApiRepository;
import com.dg.lecheng.api.user.model.InfoRoleAuth;
import com.dg.lecheng.base.core.repo.CrudRepo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 由MyBatis Generator工具自动生成，请不要手动修改
 */
@ApiRepository
public interface InfoRoleAuthDao extends CrudRepo<InfoRoleAuth, Integer> {
    public int getCount();

    public List<InfoRoleAuth> getByRoleId(Integer roleId);

    public InfoRoleAuth getByRoleAndAuthId(InfoRoleAuth infoRoleAuth);

    public List<Map> findRoleAuthByRoleId(int roleId);

    public void removeByRoleId(int roleId);

    public void removeByAuthId(int authId);

    public void addList(List<Map> list);

    public List<Map> findAuthByRoleId(int roleId);

    /**
     * 保存角色-资源
     * @param roleId
     * @param authIds
     */
    void saveRoleAuth(@Param("roleId") Integer roleId, @Param("list") List<Integer> authIds);
}